package control.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import control.mapper.authmanage.RoleAuthMapper;
import control.module.po.authmanage.RoleAuth;
import control.service.IRoleAuthService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色权限表 服务实现类
 * </p>
 *
 * @author cyj
 * @since 2020-10-21
 */
@Service
public class RoleAuthServiceImpl extends ServiceImpl<RoleAuthMapper, RoleAuth> implements IRoleAuthService {

    @Override
    public boolean removeByRoleId(Integer roleId) {
        return remove(new QueryWrapper<>(new RoleAuth().setRoleId(roleId)));
    }

    @Override
    public List<RoleAuth> getByRoleId(Integer roleId) {
        return this.baseMapper.selectList(new QueryWrapper<>(new RoleAuth().setRoleId(roleId)));
    }
}
